using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using sbMembership.Library.Presenters.ViewInterfaces;
using sbMembership.Library.Presenters;

namespace sbMembership.Web.Views
{
    public partial class AddRoleView : System.Web.UI.UserControl, IAddRoleView
    {
        AddRolePresenter presenter;

        public void AttachPresenter(AddRolePresenter presenter)
        {
            this.presenter = presenter;
        }

        public string Message
        {
            set { lblMessage.Text = value; }
        }

        public string RoleToAdd
        {
            get
            {
                return txtRolename.Text;
            }
        }

        public void ResetForm()
        {
            txtRolename.Text = string.Empty;
            ScriptManager.GetCurrent(this.Page).SetFocus(txtRolename);
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnAddRoleOK_Click(object sender, EventArgs e)
        {
            Page.Validate("AddRole");
            presenter.AddRole(Page.IsValid);
        }
    }
}